// 将对象转换为get传参
module.exports.stringfiy=function(obj){
    let arr = []
    for (let key in obj) {
        arr.push(`${key}=${obj[key]}`)
    }
    return arr.join('&')
}


// get参数转化为对象类型
module.exports.parse = function (getData) {
    // let getData ='k=1&l=2'
    let obj = {}
    let arr = getData.split('&')
    arr.forEach(item => {
        let temp = item.split('=')
        let keyTemp = temp[0]
        obj[keyTemp] = temp[1]
    })
    return obj
}
